<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>首页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../res/layui/css/layui.css"
          media="all">
    <link rel="stylesheet" href="res/css/admin.css"
          media="all">
    <link rel="stylesheet" href="../res/css/font-awesome.min.css"
          media="all">
    <style type="text/css">
        /*滚动条样式*/
        .innerbox::-webkit-scrollbar { /*滚动条整体样式*/
            width: 6px; /*高宽分别对应横竖滚动条的尺寸*/
            height: 6px;
        }

        .innerbox::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: rgba(0, 0, 0, 0.2);
        }

        .innerbox::-webkit-scrollbar-track { /*滚动条里面轨道*/
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            border-radius: 0;
            background: rgba(0, 0, 0, 0.1);
        }

        .layui-input {
            border: none;
        }

        .layui-col-md3 {
            width: 25%;
        }

        .zc {
            width: 100%;
            height: 30px;
            background-color: #F0F0F0;
        }

        .span {
            display: block;
            float: left;
            width: 46%;
            line-height: 30px;
            padding: 0px 2%;
        }

        .spans{
            display: block;
            float: left;
            width: 29%;
            line-height: 30px;
            padding: 0px 2%;
        }

        .zc_centent {
            width: 100%;
            height: 30px;
            border-bottom: 1px dashed #c2c2c2;
            cursor:pointer;
        }

        .zc_centents {
            width: 100%;
            height: 30px;
            border-bottom: 1px dashed #c2c2c2;
            cursor:pointer;
        }

        .zc_centent:hover {
            background-color: #F0F0F0;
        }

        .zc_centents:hover {
            background-color: #F0F0F0;
        }

        #test-n2 {
            position: relative;
            min-height: 400px !important;
            width: 100% !important;
        }

        #test-n2 #layui-laydate1, #test-n2 #layui-laydate1 .layui-laydate-main, #test-n2 .layui-laydate-content table {
            width: 100%;
        }

        #test-n2 .layui-laydate-content table tbody {
            height: calc(100vh - 240px) !important;
        }

        .shade {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0px;
            left: 0px;

        }


        /*右键菜单栏*/
        .wrap-ms-right {
            list-style: none;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 9999;
            padding: 5px 0;
            min-width: 80px;
            margin: 0;
            display: none;
            font-family: "微软雅黑";
            font-size: 14px;
            background-color: #fff;
            border: 1px solid rgba(0, 0, 0, .15);
            box-sizing: border-box;
            border-radius: 4px;
            -webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            -moz-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            -ms-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            -o-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .ms-item {
            height: 30px;
            line-height: 30px;
            text-align: center;
            cursor: pointer;
        }

        .ms-item:hover {
            background-color: #343a40;
            color: #FFFFFF;
        }




        #audits{
            display: none;
        }
    </style>
</head>
<body class="innerbox">
<div class="shade"></div>
<div class="wrap-ms-right" style="display: none; top: 170px; left: 504px;">
    <li class="ms-item" data-item="0"><i class="fa fa-plus" data-item="0"></i>&nbsp; 添加
    </li>
    <li class="ms-item" data-item="1"><i class="fa fa-files-o" data-item="1"></i>&nbsp;
        修改
    </li>
    <li class="ms-item" data-item="2"><i class="fa fa-files-o" data-item="2"></i>&nbsp;
        查看
    </li>
    <li class="ms-item" data-item="3"><i class="fa fa-trash" data-item="3"></i>&nbsp; 删除
    </li>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm8" style="width:100%">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-sm6">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            &nbsp;&nbsp;公务信息
                            <div class="layuiadmin-btn-group" style="position:absolute;top:0px;">
                                <div class="layui-inline">
                                    <div class="layui-input-inline" style="margin-right: 100px">
                                        <input type="text" class="layui-input year" id="officialDate"
                                               placeholder="请选择年份"
                                               style="height:30px;width:120px;position:relative;top:-2px;left:-10px;">
                                    </div>
                                    <div class="layuiadmin-btn-group" style="position:absolute;top:0px;">
                                        <a href="javascript:;" id="official" class="layui-btn layui-btn-xs">更多</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-card-body innerbox"
                             style="overflow-x: auto; overflow-y: auto; height: 370px; width:94%;">
                            <div class="zc">
                                <span class="span">公告标题</span>
                                <span class="span">发布时间</span>
                            </div>
                            <div class="layui-card-body" id="officialData"
                                 style="overflow-x: auto; overflow-y: auto; height: 315px; width:94%;">
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-sm6">
                    <div class="layui-card">
                        <div class="layui-card-header">&nbsp;&nbsp;通知公告
                            <div class="layuiadmin-btn-group" style="position:absolute;top:0px;">
                                <div class="layuiadmin-btn-group" style="position:absolute;top:0px;">
                                    <div class="layui-inline">
                                        <div class="layui-input-inline" style="margin-right: 100px">
                                            <input type="text" class="layui-input year" id="noticeDate"
                                                   placeholder="请选择年份"
                                                   style="height:30px;width:120px;position:relative;top:-2px;left:-10px;">
                                        </div>
                                        <div class="layuiadmin-btn-group" style="position:absolute;top:0px;">
                                            <a href="javascript:;" id="notice" class="layui-btn layui-btn-xs selectAlls">更多</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-card-body innerbox"
                             style="overflow-x: auto; overflow-y: auto; height: 370px; width:94%;">
                            <!-- <table class="layui-table" lay-data="{height:315, url:'../../policy/findAll', page:true, id:'test',size:'sm'}" lay-filter="test">
                              <thead>
                                <tr>
                                  <th lay-data="{field:'policyName', width:80}">政策名称</th>
                                  <th lay-data="{field:'policyComment', width:80}">政策内容</th>
                                  <th lay-data="{field:'policyPerson', width:80}">政策发布人</th>
                                  <th lay-data="{field:'policyTime', width:80}">发布时间</th>
                                  <th lay-data="{field:'company_name', width:80}">公司名称</th>
                                </tr>
                              </thead>
                            </table> -->
                            <div class="zc">
                                <span class="span">公告标题</span>
                                <span class="span">发布时间</span>
                            </div>
                            <div id="noticeData">
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>

                                <!--<a href="#">
                                   <div class="zc_centent">
                                       <span class="span">政策标题</span>
                                       <span class="span">发布时间</span>
                                   </div>
                               </a>-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-sm8" style="width:100%">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-sm6">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            &nbsp;&nbsp;文件政策
                            <div class="layuiadmin-btn-group" style="position:absolute;top:0px;">
                                <div class="layui-inline">
                                    <div class="layui-input-inline" style="margin-right: 100px">
                                        <input type="text" class="layui-input year" id="filesDate"
                                               placeholder="请选择年份"
                                               style="height:30px;width:120px;position:relative;top:-2px;left:-10px;">
                                    </div>
                                    <div class="layuiadmin-btn-group" style="position:absolute;top:0px;">
                                        <a href="javascript:;" id="files" class="layui-btn layui-btn-xs">更多</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-card-body innerbox"
                             style="overflow-x: auto; overflow-y: auto; height: 370px; width:94%;">
                            <div class="zc">
                                <span class="span">公告标题</span>
                                <span class="span">发布时间</span>
                            </div>
                            <div class="layui-card-body" id="filesData"
                                 style="overflow-x: auto; overflow-y: auto; height: 315px; width:94%;">
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-sm6">
                    <div class="layui-card">
                        <div class="layui-card-header">学习方案
                            <div class="layuiadmin-btn-group" style="position:absolute;top:0px;">
                                <div class="layui-inline">
                                    <div class="layui-input-inline" style="margin-right: 100px">
                                        <input type="text" class="layui-input year" id="studyDate"
                                               placeholder="请选择年份"
                                               style="height:30px;width:120px;position:relative;top:-2px;left:-10px;">
                                    </div>
                                    <div class="layuiadmin-btn-group" style="position:absolute;top:0px;">
                                        <a href="javascript:;" id="study" class="layui-btn layui-btn-xs">更多</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-card-body innerbox"
                             style="overflow-x: auto; overflow-y: auto; height: 370px; width:94%;">
                            <div class="zc">
                                <span class="span">公告标题</span>
                                <span class="span">发布时间</span>
                            </div>
                            <div id="studyData">
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-sm8" style="width:100%">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-sm6" id="audits">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            审核管理
                            <!--<div class="layuiadmin-btn-group" style="position:absolute;top:0px;">
                                <div class="layui-inline">
                                    <div class="layui-input-inline" style="margin-right: 100px">
                                        <input type="text" class="layui-input year" id="auditDate"
                                               placeholder="请选择年份"
                                               style="height:30px;width:120px;position:relative;top:-2px;left:-10px;">
                                    </div>
                                    <div class="layuiadmin-btn-group" style="position:absolute;top:0px;">
                                        <a href="javascript:;" id="audit" class="layui-btn layui-btn-xs">更多</a>
                                    </div>
                                </div>
                            </div>-->
                        </div>
                        <div class="layui-card-body innerbox"
                             style="overflow-x: auto; overflow-y: auto; height: 370px; width:94%;">
                            <div class="zc">
                                <span class="spans">审核类型</span>
                                <span class="spans">审核标题</span>
                                <span class="spans">发布时间</span>
                            </div>
                            <div class="layui-card-body" id="auditData"
                                 style="overflow-x: auto; overflow-y: auto; height: 315px; width:94%;">
                                <div class="zc_centent">
                                    <span class="spans">方案信息审核</span>
                                    <span class="spans">测试这个地方可以容下多少个字</span>
                                    <span class="spans">2019-11-04 15:05:29</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                                <div class="zc_centent">
                                    <span class="span">政策标题</span>
                                    <span class="span">发布时间</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</div>
</div>

<script src="../res/layui/layui.js"></script>
<script type="text/javascript" src="../res/js/base.js"></script>
<script src="res/js/echarts.min.js"></script>
<script type="text/javascript" src="res/js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="../res/js/calendar.js"></script>
<script type="text/javascript" src="../res/js/login_common.js"></script>
<script type="text/javascript" src="../res/js/mouseRight.min.js"></script>
<script type="text/javascript">
    $.ajaxSetup({
        async: false
    });

</script>
<script type="text/javascript">

    var matchDate = "";
    var matchId = "";

    function atsBaseMatch() {

        $('.calendar-body').mouseRight({
            menu: [{
                itemName: "添加",
                icon: "fa fa-plus",
                callback: function () {
                    layer.open({
                        type: 2,
                        title: '操作',
                        shadeClose: true,
                        shade: false,
                        maxmin: true, //开启最大化最小化按钮
                        area: ['893px', '600px'],
                        content: '../pages/atsBaseMatch/AtsBaseMatchForm.html?matchDate=' + matchDate
                    });
                }
            }, {
                itemName: "修改",
                icon: "fa fa-files-o",
                callback: function () {
                    if (matchId) {
                        layer.open({
                            type: 2,
                            title: '操作',
                            shadeClose: true,
                            shade: false,
                            maxmin: true, //开启最大化最小化按钮
                            area: ['893px', '600px'],
                            content: '../pages/atsBaseMatch/AtsBaseMatchSelect.html?matchId=' + matchId
                        });
                    } else {
                        layer.msg('无事项');
                    }
                }
            }, {
                itemName: "查看",
                icon: "fa fa-search",
                callback: function () {
                    var url = "../atsBaseMatch/selects";
                    var data = {matchIds: matchId}
                    $.post(url, data, function (obj) {
                        //tab层
                        layer.tab({
                            area: ['600px', '300px'],
                            tab: obj
                        });
                    })
                }
            }, {
                itemName: "删除",
                icon: "fa fa-trash-o fa-fw",
                callback: function () {
                    if (matchId) {
                        layer.msg('删除操作');
                        layer.open({
                            type: 2,
                            title: '操作',
                            shadeClose: true,
                            shade: false,
                            maxmin: true, //开启最大化最小化按钮
                            area: ['893px', '600px'],
                            content: '../pages/atsBaseMatch/AtsBaseMatchDelete.html?matchId=' + matchId
                        });
                    } else {
                        layer.msg('无事项');
                    }
                }
            }]
        });
    }
    $(function () {

       /* if(hasPrivilege("AUDITS_SHOW")){
            alert("1");
            audit(data)
            alert("2");
            $("#audits").show();

        }*/

console.info("加载首页")
        atsBaseMatch();
        var data = {"attachType": 10, "page": 1, "limit": 10};
        notice(data)
        var data = {"attachType": 20, "page": 1, "limit": 10};
        official(data)
        var data = {"attachType": 30, "page": 1, "limit": 10};
        files(data)
        var data = {"attachType": 40, "page": 1, "limit": 10};
        study(data)

        //日历点击事件
        $(".calendar-date").on("click", function () {
            console.info("进入日历点击事件")
            matchDate = $(this).attr("dates");
            matchId = $(this).attr("matchid");
        })

        $(".zc_centent").on("click",function () {
            var attach=$(this);
            var data={attachId:$(this).prop("id")}
            layer.open({
                type:2,
                title:'查看',
                skin: 'layui-layer-molv',//样式
                shadeClose:true,
                shade:0.8,
                area:['50%','90%'],
                content:'../pages/AtsAttachment/check.html?attachId='+$(this).prop("id"),
                shade: [1.2, '#3F3F3F'] ,//显示遮罩
                shadeClose: true,//点击也能遮罩层关闭
                anim: 1,//弹出动画
                end:function(){
                    attach.css("color","black")
                }
            });
        })

        $(".zc_centents").on("click",function () {
            console.info($(this).prop("id"))
            var datas = $(this).prop("id").split("_")
            console.info(datas[1]);
            console.info(datas[0]);
            if(datas[0]==1){
                layer.open({
                    type:2,
                    title:'审核',
                    skin: 'layui-layer-molv',//样式
                    shadeClose:true,
                    shade:0.8,
                    area:['50%','90%'],
                    content:'../pages/AtsScheme/AtsSchemeAudit.html?schemeId='+datas[1],
                    shade: [1.2, '#3F3F3F'] ,//显示遮罩
                    shadeClose: true,//点击也能遮罩层关闭
                    anim: 1,//弹出动画
                });
            }else{
                layer.open({
                    type:2,
                    title:'审核',
                    skin: 'layui-layer-molv',//样式
                    shadeClose:true,
                    shade:0.8,
                    area:['50%','90%'],
                    content:'../pages/atsattachment/atsattachmentShenke.html?attachId='+datas[1],
                    shade: [1.2, '#3F3F3F'] ,//显示遮罩
                    shadeClose: true,//点击也能遮罩层关闭
                    anim: 1,//弹出动画
                });
            }

        })

        var rivId=getQueryStringOne("rivId");



        //公务信息
        $("#official").on("click",function () {

            alert("公务信息");
            layer.open({
                type: 2,
                title: '操作',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['80%', '90%'],
                content: '../pages/atsattachment/atsattachment.html?attachType=20&pdsh=1&pdll=1&pdck=1'
            });
        })



        //通知公告
        $("#notice").on("click",function () {
            layer.open({
                type: 2,
                title: '操作',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['80%', '90%'],
                content: '../pages/atsattachment/atsattachment.html?attachType=10&pdsh=1&pdll=1&pdck=1'
            });
        })

        //文件政策
        $("#files").on("click",function () {
            layer.open({
                type: 2,
                title: '操作',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['80%', '90%'],
                content: '../pages/atsattachment/atsattachment.html?attachType=30&pdsh=1&pdll1=&pdck=1'
            });
        })

        //学习资料
        $("#study").on("click",function () {
            layer.open({
                type: 2,
                title: '操作',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['80%', '90%'],
                content: '../pages/atsattachment/atsattachment.html?attachType=40&pdsh=1&pdll=1&pdck=1'
            });
        })


    })


    /**
     * 公务信息
     * @param data 参数
     **/
    function official(data) {
        var url = "../AtsAttachmentAction/select";
        $.post(url, data, function (obj) {
            $("#officialData").html("");
            $.each(obj.data, function (index, item) {
                var attachName = "";
                if (item.attachName.length > 15) {
                    attachName = item.attachName.substr(0, 15);
                    attachName += "..."
                } else {
                    attachName = item.attachName;
                }

                $("#officialData").append('<div id="'+item.attachId+'" class="zc_centent" title="' + item.attachName + '"><span class="span">' + attachName + '</span><span class="span">' + item.attachTime + '</span></div>')
            })
        }, "json");

    }

    /**
     * 通知公告
     * @param data 参数
     */
    function notice(data) {
        var url = "../AtsAttachmentAction/select";
        $.post(url, data, function (obj) {
            $("#noticeData").html("");
            $.each(obj.data, function (index, item) {
                var attachName = "";
                if (item.attachName.length > 15) {
                    attachName = item.attachName.substr(0, 15);
                    attachName += "..."
                } else {
                    attachName = item.attachName;
                }
                if(item.isLook == "0"){
                    $("#noticeData").append('<div style="color: red" id="'+item.attachId+'" class="zc_centent" title="' + item.attachName + '"><span class="span">' + attachName + '</span><span class="span">' + item.attachTime + '</span></div>')
                }else{
                    $("#noticeData").append('<div id="'+item.attachId+'" class="zc_centent" title="' + item.attachName + '"><span class="span">' + attachName + '</span><span class="span">' + item.attachTime + '</span></div>')
                }
            })
        }, "json");
    }



    /**
     * 文件政策
     * @param data 参数
     */
    function files(data) {
        var url = "../AtsAttachmentAction/select";
        $.post(url, data, function (obj) {

            $("#filesData").html("");
            $.each(obj.data, function (index,item) {

                var attachName = "";
                if (item.attachName.length > 15) {
                    attachName = item.attachName.substr(0, 15);
                    attachName += "..."
                } else {
                    attachName = item.attachName;
                }
                $("#filesData").append('<div id="'+item.attachId+'" class="zc_centent" title="' + item.attachName + '"><span class="span">' + attachName+ '</span><span class="span">' + item.attachTime + '</span></div>')
            })
        }, "json");
    }

    /**
     * 学习管理
     * @param data 参数
     */
    function study(data) {
        var url = "../AtsAttachmentAction/select";
        $.post(url, data, function (obj) {

            $("#studyData").html("");
            $.each(obj.data, function (index, item) {
                var attachName = "";
                if (item.attachName.length > 15) {
                    attachName = item.attachName.substr(0, 15);
                    attachName += "..."
                } else {
                    attachName = item.attachName;
                }
                $("#studyData").append('<div id="'+item.attachId+'" class="zc_centent" title="' + item.attachName + '"><span class="span">' + attachName + '</span><span class="span">' + item.attachTime + '</span></div>')
            })
        }, "json");
    }

    /**
     * 审核管理
     * @param data 参数
     */
    function audit(data) {
        var url = "../atsBaseMatch/findAuditAll";
        $.post(url, data, function (obj) {
            $("#auditData").html("");
            $.each(obj,function (index,item) {
                var auditName="";
                if(item.title.length > 12){
                    auditName = item.title.substr(0, 12);
                    auditName+="...";
                }else{
                    auditName =  item.title;
                }
                $("#auditData").append('<div class="zc_centents" id="'+item.type+'_'+item.id+'"><span class="spans">'+item.name+'</span><span class="spans" title="'+item.title+'">'+auditName+'</span><span class="spans">'+item.times+'</span></div>')
            })
        }, "json");
    }






</script>
<script type="text/javascript">
    //初始化数据表格
    layui.use('table', function () {
        var table = layui.table;
    });
</script>
<script>
    //控制时间查询
    layui.use(['laydate', 'table', 'form'], function () {
        var laydate = layui.laydate
            , table = layui.table
            , form = layui.form;
        laydate.render({
            elem: '#officialDate'
            , type: 'year'
            , done: function (value, date, endDate) {
                /*  console.log(value); //得到日期生成的值，如：2017-08-18
                 console.log(date); //得到日期时间对象：{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
                 console.log(endDate); //得结束的日期时间对象，开启范围选择（range: true）才会返回。对象成员同上。 */
                var data = {"attachType": 20, "page": 1, "limit": 10, "year": value};
                official(data);
            }
        });
        laydate.render({
            elem: '#noticeDate'
            , type: 'year'
            , done: function (value, date, endDate) {
                /* console.log(value); //得到日期生成的值，如：2017-08-18
                console.log(date); //得到日期时间对象：{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
                console.log(endDate); //得结束的日期时间对象，开启范围选择（range: true）才会返回。对象成员同上。 */
                var data = {"attachType": 10, "page": 1, "limit": 10, "year": value};
                notice(data);
            }
        });
        laydate.render({
            elem: '#filesDate'
            , type: 'year'
            , done: function (value, date, endDate) {
                /* console.log(value); //得到日期生成的值，如：2017-08-18
                console.log(date); //得到日期时间对象：{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
                console.log(endDate); //得结束的日期时间对象，开启范围选择（range: true）才会返回。对象成员同上。 */
                var data = {"filId": 1, "page": 1, "limit": 10, "year": value};
                files(data);
            }
        });

        laydate.render({
            elem: '#studyDate'
            , type: 'year'
            , done: function (value, date, endDate) {
                /*  console.log(value); //得到日期生成的值，如：2017-08-18
                 console.log(date); //得到日期时间对象：{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
                 console.log(endDate); //得结束的日期时间对象，开启范围选择（range: true）才会返回。对象成员同上。 */
                table.reload('SalesStatistics', {
                    page: {
                        curr: 1
                    },
                    where: {
                        salesYear: value
                    }
                });
            }
        });
    })


</script>
<script type="text/javascript" charset="UTF-8">
    $(function () {
        var s=1000*60*10;
        setInterval(getLoc,s);
    })

    function getLoc() {
        window.location.reload()
    }
</script>
</body>
</html>